﻿// <copyright file="Procedure.cs" company="Joe Chung">
// Copyright © 2008 by Joe Chung.
// </copyright>
namespace NScheme
{
    using System;

    public abstract class Procedure : NScheme.SchemeUtils
    {
        public string name = "anonymous procedure";

        public static Procedure proc(object x)
        {
            if (x is Procedure)
            {
                return (Procedure)x;
            }
            else
            {
                return proc(error("Not a procedure: " + stringify(x)));
            }
        }

        public override string ToString()
        {
            return "{" + this.name + "}";
        }

        public abstract object apply(Scheme interpreter, object args);
    }
}